#include "uthread.h"
#include "types.h"
#include "user.h"

void haha(){
    printf(1, "HAHAHi, I am a thread %d\n", uthread_self().tid);
    uthread_yield();
    printf(1, "It's me again. Did you miss me?%d\n", uthread_self().tid);
    uthread_yield();
    printf(1, "It's me again223456789. Did you miss me?%d\n", uthread_self().tid);

}

void dada(){
    printf(1, "DADAHi, I am a thread%d\n", uthread_self().tid);
    uthread_yield();
    printf(1, "It's me again. Did you miss me?%d\n", uthread_self().tid);
}

int main(){
    printf(1, "\n\nI'm the main thread, and I just started!\n\n");
    
    uthread_create(&haha,1);
    uthread_create(&haha,2);
    uthread_create(&haha,1);
    uthread_create(&dada,2);
    uthread_create(&dada,0);
    //   uthread_create(&dada,2);
    uthread_start_all();
    
    
    printf(1, "shouldn't be here...!!!!!\n");
    exit();
    return 1;
}